<extend name="Base/base" />
<block name='head'>
    <link rel="stylesheet" href="/Public/Admin/css/personal.css"/>
    <style>
        .textColor2{color:red}
    </style>
</block>
<block name="content" > 
    <section class="layui-larry-box">
        <div class="larry-personal">
            <div class="layui-tab">
                <blockquote class="layui-elem-quote news_search">
                    <form class="Huiform" target="_self" action="{:U('user')}" method='get'>
                        <div class="layui-input-inline">
                            <span class="btn-upload form-group">
                                <a class="search" data-url="">选择部门</a>
                                <select name="dept_id" class="layui-input search_input" style="width:200px;display:inline-block">
                                    <option value="">请选择部门</option>
                                    <foreach name="depts" item="dept">
                                        <option value="{$dept.dept_id}" {$deptId == $dept['dept_id'] ? 'selected' : ''}>{$dept.dept_name}</option>
                                    </foreach>
                                    <option value="0">离职人员</option>
                                </select>
                                <input type='hidden' id='url' value='{:U("getFlowSort")}'>
                            </span>
                        </div>
                        <div class="layui-input-inline">
                            <a class="layui-btn search_btn searchUser"> 查询</a>
                            <a class="layui-btn search_btn updateEmail" data-url="{:U('updateEmail')}" style="margin-left:20px"> 更新企业邮箱</a>
                        </div>
                    </form>
                </blockquote>
                <div class="layui-block" style="text-align:right;margin-top:15px;">
                    <a class="layui-btn search_btn search" href="{:U('saveUser')}" style="margin-left:10px;margin-bottom: 10px;">新建用户</a>
                </div>
                <div class="layui-tab-content larry-personal-body clearfix mylog-info-box">
                    <!-- 列表 -->
                    <div class="layui-tab-item layui-field-box layui-show">
                        <table class="layui-table table-hover ftable" lay-even="" lay-skin="nob">
                            <thead>
                            <!--<th><input type="checkbox" name="" value=""></th>-->
                            <th style="width:100px">用户头像</th>
                            <th>用户名</th>
                            <th>用户姓名</th>
                            <th>部门</th>
                            <th>角色</th>
                            <th>最后登录</th>
                            <th>微信ID</th>
                            <th>企业邮箱</th>
                            <th width="15%">操作</th>
                            </thead>
                            <tbody class="tbody">
                            <notempty name="datas">
                                <foreach name="datas" item="row">
                                    <tr class="text-c {$row.class}">
                                        <!--<td><input class="more" name="id[]" type="checkbox" value="{$row.flow_id}"></td>-->
                                        <td><img src="{$row.head|default='/Public/Index/img/no-head.jpg'}" style="padding: 5px 0;width:50px;border-radius: 50%"/></td>
                                        <td>{$row.user_id}</td>
                                        <td>{$row.user_name}</td>
                                        <td>{$row.dept_id|getDeptName}</td>
                                        <td>{$row.user_priv|getPrivName}</td>
                                        <td>{$row.last_visit_time}</td>
                                        <td>{$row.openid}</td>
                                        <td>{$row.email}</td>
                                        <td class="f-14 product-brand-manage">
                                            <a style="text-decoration:none" href="{:U('saveUser',array('id'=>$row[user_id]))}" title="编辑">编辑</a> 
                                            <a style="text-decoration:none" class="ml-5 clearPwd pointer" data-url="{:U('clearPassword',array('id'=>$row['user_id']))}"  title="清空密码">清空密码</a>
                                            <a style="text-decoration:none" class="ml-5 updateAddress pointer" data-url="{:U('updateAddress',array('user_id'=>$row['user_id']))}"  title="同步到通讯录">同步</a>
                                    <if condition="$del eq 1">
                                        <a style="text-decoration:none" class="ml-5 delete pointer" data-confirm="确定要删除该用户吗?" data-url="{:U('delUser',array('user_id'=>$row['user_id']))}"  title="删除用户">删除用户</a>
                                    </if>
                                    </td>
                                    </tr>
                                </foreach>
                                <else/>
                                <tr><td colspan="2" style="border-bottom: 1px solid #fff;border-left: 1px solid #fff;text-align: left">暂无数据</td></tr>
                            </notempty>
                            </tbody>
                        </table>
                        <div class="larry-table-page clearfix">
                            <!--<a href="javascript:;" class="layui-btn layui-btn-small"><i class="iconfont icon-shanchu1"></i>删除</a>-->
                            <div id="page" class="page">{$page}</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
</block>
<block name="script">
    <script type="text/javascript" src="/Public/Admin/js/admin.js"></script>
     <script type="text/javascript" src="/Public/Admin/js/common.js"></script>
    <script type="text/javascript">
        $(initUser());

    </script>    
</block>

